<?php
include '../include/functions.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//Dtd html 4.01 Transitional//EN"
"http://www.w3.org/tr/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/MAIN.dwt.php" codeOutsideHTMLIsLocked="false" -->
  <head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>JoshHughes.com NFL Football Pool</title>
    <!-- InstanceEndEditable -->
	<link rel="stylesheet" href="http://football.joshhughes.com/css/NFL.css" type="text/css">
	<script src="http://football.joshhughes.com/scripts/prototype.js" type="text/javascript"></script>
	<script src="http://football.joshhughes.com/scripts/scriptaculous.js" type="text/javascript"></script>
	<script src="http://football.joshhughes.com/scripts/football.js" type="text/javascript"></script>
    <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
  </head>
<body obload="doreload()">
<div id="pagewidth" >
	<div id="header" >
	
		<?PHP include_once("layout/header.html"); ?>
		
	</div>
			<div id="wrapper" class="clearfix" > 
				<div id="maincol" >
	
				<!-- InstanceBeginEditable name="Contents" -->					
					
				<?php
				dbConnect();                                 
				//check to see if a Weeknum value was passed, if not, set WeekNum to CurrWeek.
				if (($Weeknum == NULL) || ($Weeknum == ""))
					$Weeknum = getWeek("NFL");
										
				//check to make sure $Weeknum > 1 AND $Weeknum < 21
				$Weeknum = checkWeekBounds($Weeknum);
				
				if (gameInProgress($Weeknum, "NFL"))
				{	?>
					<script type="text/javascript">setTimeout('doreload()',30000);</script>
					<?
				}
				else
				{
					$NumMins = 10;
					$TimeOutSecs = $NumMins * 60000;
				}
				?>
				
				<form action="<? echo $PHP_SELF; ?>" method="POST" name="WeekForm">
					<table bgcolor="#FFFFFF" callpadding="0" cellspacing="0" width="575">
						<tr>
							<td width="325" align="center"><h2>NFL Game Day Scores</h2></td>
							<td width="250" align="right" valign="top">
								<a href="<? echo $PHP_SELF; ?>?Weeknum=<? echo $Weeknum-1; ?>" class="permLink">Prev</a> | 
								<a href="<? echo $PHP_SELF; ?>?Weeknum=<? echo $Weeknum+1; ?>" class="permLink">Next</a> &nbsp; or &nbsp; 
								<B>Go to:</B><?	WeekDropDown($Weeknum)	?>
							</td>
						</tr>
					</table>
				</form>
				
				<div class="bluebg" style="width: 575px; padding: 2px;">
					<table width="100%" cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td align="left"><span class="whitelink">View Game Scores</span></td>
							<td align="right"><img src="http://football.joshhughes.com/images/showhide.gif" title="Show/Hide Scores" alt="Show/Hide Scores" border="0"  onclick="new Effect.toggle('scoresframe', 'blind');" /></td>
						</tr>
					</table>
					<iframe id="scoresframe" name="scoresframe" src="http://football.joshhughes.com/NFL/rss/<?= getSeasonYear("NFL"); ?>/week<?= $Weeknum; ?>.xml" height="350" width="100%" frameborder="0" scrolling="no" ></iframe>
				</div>
				<!-- InstanceEndEditable -->
			
			</div>
			<div id="leftcol" >
			
				<?PHP include_once("layout/left_column.php"); ?>
		
			</div>
			
		</div>
		
		<div id="footer" >
		
			<?PHP include_once("layout/footer.html"); ?>
			
		</div>
</div>
</body>
<!-- InstanceEnd --></html>
